package net.lab1024.sa.ai.stream.module.business.ai.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import net.lab1024.sa.ai.stream.module.business.ai.entity.AiRolePromptEntity;
import net.lab1024.sa.ai.stream.module.business.ai.mapper.AiRolePromptMapper;
import net.lab1024.sa.ai.stream.module.business.ai.service.AiRolePromptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AiRolePromptServiceImpl implements AiRolePromptService {
    @Autowired
    private AiRolePromptMapper aiRolePromptMapper;

    @Override
    public void add(AiRolePromptEntity entity) {
        aiRolePromptMapper.insert(entity);
    }

    @Override
    public void update(AiRolePromptEntity entity) {
        aiRolePromptMapper.updateById(entity);
    }

    @Override
    public void delete(Long id) {
        aiRolePromptMapper.deleteById(id);
    }

    @Override
    public AiRolePromptEntity getById(Long id) {
        return aiRolePromptMapper.selectById(id);
    }

    @Override
    public List<AiRolePromptEntity> listByRoleId(Long roleId) {
        return aiRolePromptMapper.selectList(new LambdaQueryWrapper<AiRolePromptEntity>().eq(AiRolePromptEntity::getRoleId, roleId).orderByAsc(AiRolePromptEntity::getSort));
    }

    @Override
    public List<AiRolePromptEntity> listByAliasList(Long roleId, List<String> aliasList) {
        return aiRolePromptMapper.selectByAliasList(roleId, aliasList);
    }
} 